﻿#include "X917Random.h"

using namespace CryptoPP;

namespace XyNet
{
	XYNET_IMPLEMENT_DEFAULT_OBJECT(X917Random);

	byte X917Random::GenerateByte()
	{
		unique_lock<mutex> lock(_mutex);
		return super::GenerateByte();
	}

	unsigned int X917Random::GenerateBit()
	{
		unique_lock<mutex> lock(_mutex);
		return super::GenerateBit();
	}

	CryptoPP::word32 X917Random::GenerateWord32(CryptoPP::word32 min /*= 0*/, CryptoPP::word32 max /*= 0xffffffffUL*/)
	{
		unique_lock<mutex> lock(_mutex);
		return super::GenerateWord32(min, max);
	}

	void X917Random::GenerateBlock(byte *output, size_t size)
	{
		unique_lock<mutex> lock(_mutex);
		super::GenerateBlock(output, size);
	}
}